Add a helper method to get a random java.util.TimeZone#29487
Merged
dakrone merged 2 commits intoelastic:masterfrom Apr 12, 2018
Merged
Add a helper method to get a random java.util.TimeZone#29487dakrone merged 2 commits intoelastic:masterfrom
dakrone merged 2 commits intoelastic:masterfrom
Conversation
This adds a helper method to ESTestCase that returns a randomized `java.util.TimeZone`. This can be used when transitioning code from Joda to the JDK's time classes.
Collaborator
|
Pinging @elastic/es-core-infra |
rjernst
approved these changes
Apr 12, 2018
| * generate a random TimeZone from the ones available in java.time | ||
| */ | ||
| public static TimeZone randomTimeZone() { | ||
| List<String> ids = Arrays.asList(TimeZone.getAvailableIDs()); |
Member
There was a problem hiding this comment.
Could these be statically loaded so calls to this do not each need to do a sort?
Member
There was a problem hiding this comment.
I'm just looking at how we currently do this for the joda DateTimeZone in randomDateTimeZone, I think that method would benefit slighty as well from making the sorted IDs static. Would make sense to maybe change this in one go?
Member
Author
There was a problem hiding this comment.
I switched them both to use statically initialized and sorted lists
cbuescher
approved these changes
Apr 12, 2018
Member
cbuescher
left a comment
There was a problem hiding this comment.
Thanks for also changing the joda time zone helper.
dakrone
added a commit
that referenced
this pull request
Apr 12, 2018
* Add a helper method to get a random java.util.TimeZone This adds a helper method to ESTestCase that returns a randomized `java.util.TimeZone`. This can be used when transitioning code from Joda to the JDK's time classes.
jasontedor
added a commit
to jasontedor/elasticsearch
that referenced
this pull request
Apr 13, 2018
* master: Enable skipping fetching latest for BWC builds (elastic#29497) Add remote cluster client (elastic#29495) Ensure flush happens on shard idle Adds SpanGapQueryBuilder in the query DSL (elastic#28636) Control max size and count of warning headers (elastic#28427) Make index APIs work without types. (elastic#29479) Deprecate filtering on `_type`. (elastic#29468) Fix auto-generated ID example format (elastic#29461) Fix typo in max number of threads check docs (elastic#29469) Add primary term to translog header (elastic#29227) Add a helper method to get a random java.util.TimeZone (elastic#29487) Move TimeValue into elasticsearch-core project (elastic#29486)
martijnvg
added a commit
that referenced
this pull request
Apr 13, 2018
* es/master: Add remote cluster client (#29495) Ensure flush happens on shard idle Adds SpanGapQueryBuilder in the query DSL (#28636) Control max size and count of warning headers (#28427) Make index APIs work without types. (#29479) Deprecate filtering on `_type`. (#29468) Fix auto-generated ID example format (#29461) Fix typo in max number of threads check docs (#29469) Add primary term to translog header (#29227) Add a helper method to get a random java.util.TimeZone (#29487) Move TimeValue into elasticsearch-core project (#29486) Fix NPE in InternalGeoCentroidTests#testReduceRandom (#29481) Build: introduce keystoreFile for cluster config (#29491) test: Index more docs, so that it is less likely the search request does not time out.
martijnvg
added a commit
that referenced
this pull request
Apr 13, 2018
* es/6.x: Enable skipping fetching latest for BWC builds (#29497) Add remote cluster client (#29495) Ensure flush happens on shard idle Adds SpanGapQueryBuilder in the query DSL (#28636) Fix auto-generated ID example format (#29461) Fix typo in max number of threads check docs (#29469) Add primary term to translog header (#29227) Add a helper method to get a random java.util.TimeZone (#29487) Move TimeValue into elasticsearch-core project (#29486) Fix NPE in InternalGeoCentroidTests#testReduceRandom (#29481) Build: introduce keystoreFile for cluster config (#29491) test: Index more docs, so that it is less likely the search request does not time out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a helper method to ESTestCase that returns a randomized
java.util.TimeZone. This can be used when transitioning code from Joda to theJDK's time classes.